<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        span {
            border: 1px dashed red;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div></div>
</body>
<script src="js/itcast.core.js"></script>
<script src="js/itcast.dom.js"></script>
<script src="js/itcast.ctor.js"></script>
<script>
    var arr = [],
        push = arr.push;
    /*Itcast.fn.appendTo = function(dom){
        dom.appendChild( this[ 0 ] );
        return this;
    }*/

    /*Itcast.fn.appendTo = function(dom){
        this.each(function(i,v){
            return dom.appendChild( this );
        });
        return this;
    }*/

    Itcast.fn.appendTo = function(dom){
        return this.each(function(i,v){
            return dom.appendChild( this );
        });
    }




</script>

<script>
    var div = I('div');
    I(
            '<span style="border: 1px dashed red;">span1</span>' +
            '<span style="border: 1px dashed red;">span2</span>' +
            '<span style="border: 1px dashed red;">span3</span>' +
            '<span style="border: 1px dashed red;">span4</span>' +
    '')
    .appendTo( I('div').get(0) );



</script>


</html>